package com.demo;

import com.demo.impl.GreetAboutTimeImpl;
import com.demo.impl.GreetToUserImpl;

import java.util.Date;

public class HelloWorld {
    private GreetToUser greetToUser;
    private GreetAboutTime greetAboutTime;

    public GreetToUser getGreetToUser() {
        return greetToUser;
    }

    public void setGreetToUser(GreetToUser greetToUser) {
        this.greetToUser = greetToUser;
    }

    public GreetAboutTime getGreetAboutTime() {
        return greetAboutTime;
    }

    public void setGreetAboutTime(GreetAboutTime greetAboutTime) {
        this.greetAboutTime = greetAboutTime;
    }

    /**
     * Say hello to everyone
     * @param now
     * @param user
     * @return the word what to say
     */
    public String sayHello(Date now, String user) {
        return greetToUser.greet(user) + "" + greetAboutTime.greet(now);
    }
}
